﻿<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/reset.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.breakly-1.0.js")" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        $(function () {
//            $("h1").breakly(14);
            $("#menu-container li").breakly(3);
//            $("#breadcrumbs").breakly(14);

            $('.manifest-selector').click(function (e) {
                e.preventDefault();
                showManifest();
            });

            $("#manifest").click(function (e) {
                e.stopPropagation();
            });

            $("body:not(#manifest)").click(function (e) {
                hideManifest();
            });

            function showManifest() {
                var placeholder = $("#manifests-list");
                $("#manifest").addClass("active")
                placeholder.show();
            }

            function hideManifest() {
                var placeholder = $("#manifests-list");
                $("#manifest").removeClass("active")
                placeholder.hide();
            }
        });
    </script>
</head>
<body>
    <div id="header-container">
        <a href="@Html.GetVersionedHomePath(Model.CurrentManifest as Manifest)">
            <img alt="logo" id="logo" src="@Url.Content("~/Content/logo.png")" /></a></div>
    <div id="main-container">
        <div id="menu-container">
            <h1>@Model.CurrentManifest.Environment</h1>
            <h2>
                Applications</h2>
            <ul>
                @foreach (BizTalkApplication application in ViewBag.Applications)
                {
                    if (ViewBag.CurrentMenuItem == application.Name)
                    { 
                    <li class="active">@application.Name</li>
                    }
                    else
                    {
                    <li><a href="@application.Path(Model.CurrentManifest as Manifest)">@application.Name</a></li>
                    }
                }
            </ul>
            @* <h2>Hosts</h2>
            <ul>
                @foreach (Host host in ViewBag.Hosts)
                {
                    if (ViewBag.CurrentMenuItem == host.Name)
                    {
                    <li class="active">@host.Name</li>
                    }
                    else
                    {
                    <li><a href="@host.Path(ViewBag.Version as string)">@host.Name</a></li>
                    }
                }
            </ul>*@
        </div>
        <div id="content-container">
            <div id="content">
                <div id="title">
                    <h1>@RenderSection("ArtifactTitle", required: false)</h1>
                </div>
                <div id="links-container">
                    <div id="breadcrumbs">
                        @Html.Breadcrumbs(ViewBag.BreadCrumbs as List<BizTalkBaseObject>, ViewBag.CurrentManifest as Manifest)
                    </div>
                    <div id="manifest">
                        Version: <a href="#" class="manifest-selector">@Model.CurrentManifest.Name</a>&nbsp;<a
                            href="#"><img alt="versions" class="manifest-selector" src="@Url.Content("~/Content/dropdown-arrow.png")" /></a>
                        @RenderSection("ManifestList", required: false)</div>
                </div>
                <div id="body">
                    @RenderBody()
                </div>
            </div>
        </div>
        <div style="clear: both;">
        </div>
    </div>
    <div id="footer-container">
        <div style="float: left;">
            BizTalk Config Explorer</div>
        <div style="float: right;">@Html.Version()</div>
    </div>
</body>
</html>
